home *** CD-ROM | disk | FTP | other *** search
/ Flybox Trout (Edition 1) / Flybox Trout (Edition 1).iso / Setup / Support / FlyBox.exe / FlyBox.dxr / 00002_FlyResultsSearch.ls < prev    next >
Encoding:
Text File  |  2002-04-15  |  1.4 KB  |  44 lines

  1. global DBPath
  2.  
  3. on exitFrame me
  4.   adb = DGOpenDatabase(DBPath & "FlyBox.mdb", 0, 0, ";PWD=StopLooking")
  5.   theString = getVariable(sprite(1), "Search")
  6.   num = length(theString)
  7.   repeat with i = 1 to num
  8.     if theString.char[i] = "'" then
  9.       NewString = NewString & "''"
  10.       next repeat
  11.     end if
  12.     NewString = NewString & theString.char[i]
  13.   end repeat
  14.   qd = DGQDOpen("GetFlySearch", adb)
  15.   DGQDSetParameterValue("SearchStr", NewString, qd)
  16.   rs = DGQDCreateRS(qd)
  17.   a = 0
  18.   repeat while not DGRSisEOF(rs)
  19.     setVariable(sprite(1), "Result" & a & "_FlyID", DGRSGetFieldValue("FlyID", rs) & EMPTY)
  20.     setVariable(sprite(1), "Result" & a & "_Picture", DGRSGetFieldValue("Picture", rs))
  21.     setVariable(sprite(1), "Result" & a & "_FlyName", DGRSGetFieldValue("FlyName", rs))
  22.     setVariable(sprite(1), "Result" & a & "_Descript", DGRSGetFieldValue("Descript", rs))
  23.     DGRSmoveNext(rs)
  24.     a = a + 1
  25.   end repeat
  26.   Results = getVariable(sprite(1), "Results")
  27.   Results = Results.integer
  28.   setVariable(sprite(1), "Results", a & EMPTY)
  29.   repeat while a < Results
  30.     setVariable(sprite(1), "Result" & a & "_FlyID", EMPTY)
  31.     setVariable(sprite(1), "Result" & a & "_Picture", EMPTY)
  32.     setVariable(sprite(1), "Result" & a & "_FlyName", EMPTY)
  33.     setVariable(sprite(1), "Result" & a & "_Descript", EMPTY)
  34.     a = a + 1
  35.   end repeat
  36.   if DGQDIsOpen(qd) then
  37.     DGQDClose(qd)
  38.   end if
  39.   DGRSClose(rs)
  40.   DGClose(adb)
  41.   sprite(1).goToFrame("Results")
  42.   go("Finished")
  43. end
  44.